package com.dsh.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dsh.mapper.CategoryMapper;
import com.dsh.model.CategoryEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryService {
    @Autowired
    CategoryMapper categoryMapper;


    public List<CategoryEntity> findByParentId(Long parentId) {
        QueryWrapper<CategoryEntity> wrapper = new QueryWrapper<>();
        wrapper.lambda().eq(CategoryEntity::getParentCid,parentId);
        return categoryMapper.selectList(wrapper);
    }
}
